﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace EWMSWeb.Hardware
{
    public partial class CCList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                bindData();
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            DataLib.Model.CCEmail m = new DataLib.Model.CCEmail();
            //m.flag1 = txtCumName.Value;
            m.Name = txtName.Value;
            m.Email = txtEmail.Value;
            m.Remark = txtRemark.Value;
            DataLib.BLL.CCEmail bll = new DataLib.BLL.CCEmail();
            if (bll.Add(m) > 0)
            {
               
                txtName.Value = "";
                txtRemark.Value = "";
                txtEmail.Value = "";
                bindData();
            }
        }

        protected void bindData()
        {
            DataTable dt = new DataLib.BLL.CCEmail().GetList("").Tables[0];
            rept.DataSource = dt;
            rept.DataBind();
        }
    }
}